import Vue from 'vue'
import i18n from './assets/language/index.js'
import App from './App.vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/reset.css';
import './assets/public.css';
import './assets/iconfont/iconfont.css'
import "./style/iconfont.css"
import router from './router'
import { util } from './utlis/utlis.js'
import '../theme/index.css'
import './utlis/directive.js'
import zujian from './components/common/index.js';
import VueKeycloak from '@dsb-norge/vue-keycloak-js';
import echarts from 'echarts';
import _ from 'lodash';
import JsonViewer from 'vue-json-viewer'
Vue.use(JsonViewer)
Vue.use(ElementUI);
Vue.use(router)
Vue.config.productionTip = false
Vue.prototype.$util = util
Vue.prototype.$echarts = echarts;
Vue.prototype._ = _;
Vue.use(zujian);
let url = 'http://61.240.138.156:350/auth'

const urlIp = {
  url: url,
  // url: `${window.location.origin}/auth`,
  realm: "pae",
  clientId: "pae"
}
Vue.use(VueKeycloak, {
  init: {
    onLoad: 'login-required',
    checkLoginIframe: false
  },
  config: urlIp,
  onReady: (keycloak) => {
    new Vue({
      router,
      i18n,
      render: h => h(App),
    }).$mount('#app')
  },
  onInitError: (error) => {
    console.error(error);
  }
});
